package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenPjConfirmMapper;
import com.server.pinggu.domain.SenPjConfirm;
import com.server.pinggu.service.ISenPjConfirmService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenPjConfirmServiceImpl extends ServiceImpl<SenPjConfirmMapper, SenPjConfirm> implements ISenPjConfirmService {

    @Override
    public List<SenPjConfirm> queryList(SenPjConfirm senPjConfirm) {
        LambdaQueryWrapper<SenPjConfirm> lqw = Wrappers.lambdaQuery();
        if (senPjConfirm.getDdate() != null){
            lqw.eq(SenPjConfirm::getDdate ,senPjConfirm.getDdate());
        }
        if (senPjConfirm.getUid() != null){
            lqw.eq(SenPjConfirm::getUid ,senPjConfirm.getUid());
        }
        if (senPjConfirm.getStatus() != null){
            lqw.eq(SenPjConfirm::getStatus ,senPjConfirm.getStatus());
        }
        if (senPjConfirm.getDtime() != null){
            lqw.eq(SenPjConfirm::getDtime ,senPjConfirm.getDtime());
        }
        if (senPjConfirm.getFormid() != null){
            lqw.eq(SenPjConfirm::getFormid ,senPjConfirm.getFormid());
        }
        if (StringUtils.isNotBlank(senPjConfirm.getReason())){
            lqw.eq(SenPjConfirm::getReason ,senPjConfirm.getReason());
        }
        if (StringUtils.isNotBlank(senPjConfirm.getPsys())){
            lqw.eq(SenPjConfirm::getPsys ,senPjConfirm.getPsys());
        }
        return this.list(lqw);
    }
}